﻿using System;
using System.IO;
using SaveAssist;
using UnityEngine;

// Token: 0x020002A7 RID: 679
public class CharSave_SexyBeachPR
{
	// Token: 0x060010C7 RID: 4295 RVA: 0x000787AC File Offset: 0x000769AC
	public CharSave_SexyBeachPR(global::CharSave_SexyBeachPR.ConvertType type)
	{
		this.convertType = type;
		this.savedata = new global::CharSave_SexyBeachPR.SaveData();
	}

	// Token: 0x1700025B RID: 603
	// (get) Token: 0x060010C8 RID: 4296 RVA: 0x000787C8 File Offset: 0x000769C8
	// (set) Token: 0x060010C9 RID: 4297 RVA: 0x000787D0 File Offset: 0x000769D0
	public global::CharSave_SexyBeachPR.SaveData savedata { get; private set; }

	// Token: 0x1700025C RID: 604
	// (get) Token: 0x060010CA RID: 4298 RVA: 0x000787DC File Offset: 0x000769DC
	// (set) Token: 0x060010CB RID: 4299 RVA: 0x000787E4 File Offset: 0x000769E4
	public global::CharSave_SexyBeachPR.ConvertType convertType { get; private set; }

	// Token: 0x060010CC RID: 4300 RVA: 0x000787F0 File Offset: 0x000769F0
	public virtual string GetFileTag(string filepath = "")
	{
		string result = string.Empty;
		if (!File.Exists(filepath))
		{
			return result;
		}
		using (FileStream fileStream = new FileStream(filepath, FileMode.Open, FileAccess.Read))
		{
			using (BinaryReader binaryReader = new BinaryReader(fileStream))
			{
				if (binaryReader.BaseStream.Length == 0L)
				{
					return result;
				}
				long num = 0L;
				global::PngAssist.CheckPngData(binaryReader, ref num, true);
				if (binaryReader.BaseStream.Length - binaryReader.BaseStream.Position == 0L)
				{
					global::Debug.LogWarning("ただのPNGファイルの可能性があります。");
					return result;
				}
				try
				{
					result = binaryReader.ReadString();
				}
				catch (EndOfStreamException ex)
				{
					global::Debug.LogError("データが破損している可能性があります：" + ex.GetType().Name);
				}
			}
		}
		return result;
	}

	// Token: 0x060010CD RID: 4301 RVA: 0x000788F4 File Offset: 0x00076AF4
	public virtual bool LoadCharaFile(string filepath = "")
	{
		if (!File.Exists(filepath))
		{
			return false;
		}
		this.savedata.fileName = Path.GetFileName(filepath);
		bool result;
		using (FileStream fileStream = new FileStream(filepath, FileMode.Open, FileAccess.Read))
		{
			using (BinaryReader binaryReader = new BinaryReader(fileStream))
			{
				if (binaryReader.BaseStream.Length == 0L)
				{
					result = false;
				}
				else
				{
					this.savedata.pngData = global::PngAssist.LoadPngData(binaryReader);
					if (binaryReader.BaseStream.Length - binaryReader.BaseStream.Position == 0L)
					{
						global::Debug.LogWarning("ただのPNGファイルの可能性があります。");
						result = false;
					}
					else
					{
						try
						{
							string a = binaryReader.ReadString();
							byte sex;
							if (a == "【PremiumResortCharaFemale】")
							{
								sex = 1;
							}
							else
							{
								if (!(a == "【PremiumResortCharaMale】"))
								{
									return false;
								}
								sex = 0;
							}
							this.savedata.sex = sex;
							this.savedata.fileVersion = binaryReader.ReadInt32();
							if (this.savedata.fileVersion > 1)
							{
								result = false;
							}
							else
							{
								if (this.savedata.pngData != null && this.convertType == global::CharSave_SexyBeachPR.ConvertType.HoneySelect)
								{
									Texture2D texture2D = new Texture2D(0, 0);
									texture2D.LoadImage(this.savedata.pngData);
									global::TextureScale.Bilinear(texture2D, 252, 352);
									this.savedata.pngData = texture2D.EncodeToPNG();
								}
								int num = binaryReader.ReadInt32();
								SaveAssist.BlockHeader[] array = new SaveAssist.BlockHeader[num];
								for (int i = 0; i < num; i++)
								{
									array[i] = new SaveAssist.BlockHeader();
									array[i].LoadHeader(binaryReader);
								}
								int num2 = 0;
								num2++;
								this.savedata.customVersion = array[num2].version;
								if (this.savedata.customVersion <= 5)
								{
									binaryReader.BaseStream.Seek(array[num2].pos, SeekOrigin.Begin);
									byte[] data = binaryReader.ReadBytes((int)array[num2].size);
									if (!this.LoadCustomData(data, array[num2].version, sex))
									{
										return false;
									}
								}
								num2++;
								this.savedata.clothesVersion = array[num2].version;
								if (array[num2].version <= 2)
								{
									binaryReader.BaseStream.Seek(array[num2].pos, SeekOrigin.Begin);
									byte[] data2 = binaryReader.ReadBytes((int)array[num2].size);
									if (!this.LoadClothesData(data2, array[num2].version, sex))
									{
										return false;
									}
								}
								result = true;
							}
						}
						catch (EndOfStreamException ex)
						{
							global::Debug.LogError("データが破損している可能性があります：" + ex.GetType().Name);
							result = false;
						}
					}
				}
			}
		}
		return result;
	}

	// Token: 0x060010CE RID: 4302 RVA: 0x00078C3C File Offset: 0x00076E3C
	public virtual bool LoadCustomData(byte[] data, int version, byte sex)
	{
		bool result;
		using (MemoryStream memoryStream = new MemoryStream(data))
		{
			using (BinaryReader binaryReader = new BinaryReader(memoryStream))
			{
				binaryReader.BaseStream.Seek(1L, SeekOrigin.Current);
				this.savedata.personality = binaryReader.ReadInt32();
				this.savedata.name = binaryReader.ReadString();
				this.savedata.headId = binaryReader.ReadInt32();
				this.savedata.sbpr_shapeFace = new float[(sex != 0) ? 67 : 67];
				if (version < 3)
				{
					for (int i = 0; i < 66; i++)
					{
						this.savedata.sbpr_shapeFace[i] = (float)binaryReader.ReadDouble();
					}
				}
				else
				{
					for (int j = 0; j < this.savedata.sbpr_shapeFace.Length; j++)
					{
						this.savedata.sbpr_shapeFace[j] = (float)binaryReader.ReadDouble();
					}
				}
				this.savedata.sbpr_shapeBody = new float[(sex != 0) ? 32 : 21];
				for (int k = 0; k < this.savedata.sbpr_shapeBody.Length; k++)
				{
					this.savedata.sbpr_shapeBody[k] = (float)binaryReader.ReadDouble();
				}
				this.savedata.hairId = new int[(sex != 0) ? 4 : 1];
				for (int l = 0; l < this.savedata.hairId.Length; l++)
				{
					this.savedata.hairId[l] = binaryReader.ReadInt32();
				}
				this.savedata.hairColor = new global::CharSave_SexyBeachPR.ColorSetSBPR[(sex != 0) ? 4 : 1];
				for (int m = 0; m < this.savedata.hairColor.Length; m++)
				{
					this.savedata.hairColor[m] = new global::CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.hairColor[m].Load(binaryReader, (int)this.convertType);
				}
				this.savedata.hairAcsColor = new global::CharSave_SexyBeachPR.ColorSetSBPR[(sex != 0) ? 4 : 1];
				for (int n = 0; n < this.savedata.hairAcsColor.Length; n++)
				{
					this.savedata.hairAcsColor[n] = new global::CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.hairAcsColor[n].Load(binaryReader, (int)this.convertType);
				}
				this.savedata.texFaceId = binaryReader.ReadInt32();
				this.savedata.skinColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
				this.savedata.skinColor.Load(binaryReader, (int)this.convertType);
				if (sex == 1)
				{
					this.savedata.texEyeshadowId = binaryReader.ReadInt32();
					this.savedata.eyeshadowColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.eyeshadowColor.Load(binaryReader, (int)this.convertType);
					this.savedata.texCheekId = binaryReader.ReadInt32();
					this.savedata.cheekColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.cheekColor.Load(binaryReader, (int)this.convertType);
					this.savedata.texLipId = binaryReader.ReadInt32();
					this.savedata.lipColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.lipColor.Load(binaryReader, (int)this.convertType);
				}
				this.savedata.texTattoo_fId = binaryReader.ReadInt32();
				this.savedata.tattoo_fColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
				this.savedata.tattoo_fColor.Load(binaryReader, (int)this.convertType);
				if (sex == 1)
				{
					this.savedata.texMoleId = binaryReader.ReadInt32();
					this.savedata.moleColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.moleColor.Load(binaryReader, (int)this.convertType);
				}
				this.savedata.matEyebrowId = binaryReader.ReadInt32();
				this.savedata.eyebrowColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
				this.savedata.eyebrowColor.Load(binaryReader, (int)this.convertType);
				if (sex == 1)
				{
					this.savedata.matEyelashesId = binaryReader.ReadInt32();
					this.savedata.eyelashesColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.eyelashesColor.Load(binaryReader, (int)this.convertType);
				}
				this.savedata.matEyeLId = binaryReader.ReadInt32();
				this.savedata.eyeLColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
				this.savedata.eyeLColor.Load(binaryReader, (int)this.convertType);
				this.savedata.matEyeRId = binaryReader.ReadInt32();
				this.savedata.eyeRColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
				this.savedata.eyeRColor.Load(binaryReader, (int)this.convertType);
				if (sex == 1)
				{
					this.savedata.matEyeHiId = binaryReader.ReadInt32();
					this.savedata.eyeHiColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.eyeHiColor.Load(binaryReader, (int)this.convertType);
				}
				this.savedata.eyeWColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
				this.savedata.eyeWColor.Load(binaryReader, (int)this.convertType);
				if (version >= 2)
				{
					this.savedata.faceDetailWeight = (float)binaryReader.ReadDouble();
				}
				this.savedata.texBodyId = binaryReader.ReadInt32();
				if (sex == 1)
				{
					this.savedata.texSunburnId = binaryReader.ReadInt32();
					this.savedata.sunburnColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.sunburnColor.Load(binaryReader, (int)this.convertType);
				}
				this.savedata.texTattoo_bId = binaryReader.ReadInt32();
				this.savedata.tattoo_bColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
				this.savedata.tattoo_bColor.Load(binaryReader, (int)this.convertType);
				if (sex == 1)
				{
					this.savedata.matNipId = binaryReader.ReadInt32();
					this.savedata.nipColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.nipColor.Load(binaryReader, (int)this.convertType);
					this.savedata.matUnderhairId = binaryReader.ReadInt32();
					this.savedata.underhairColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.underhairColor.Load(binaryReader, (int)this.convertType);
					this.savedata.nailColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.nailColor.Load(binaryReader, (int)this.convertType);
					if (version >= 1)
					{
						this.savedata.nipSize = (float)binaryReader.ReadDouble();
					}
				}
				if (version >= 2)
				{
					this.savedata.bodyDetailWeight = (float)binaryReader.ReadDouble();
					if (this.convertType == global::CharSave_SexyBeachPR.ConvertType.HoneySelect)
					{
						this.savedata.bodyDetailWeight *= 0.6f;
					}
				}
				if (sex == 0)
				{
					this.savedata.beardId = binaryReader.ReadInt32();
					this.savedata.beardColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.beardColor.Load(binaryReader, (int)this.convertType);
				}
				else
				{
					if (version >= 4)
					{
						binaryReader.BaseStream.Seek(4L, SeekOrigin.Current);
					}
					if (version >= 5)
					{
						this.savedata.bustSoftness = (float)binaryReader.ReadDouble();
						this.savedata.bustWeight = (float)binaryReader.ReadDouble();
					}
				}
				if (this.convertType == global::CharSave_SexyBeachPR.ConvertType.HoneySelect)
				{
					if (sex == 1)
					{
						if (14 > this.savedata.personality || this.savedata.personality > 18)
						{
							this.savedata.personality = 0;
						}
						else
						{
							this.savedata.personality -= 14;
						}
						int[] array = new int[]
						{
							0,
							2,
							3,
							3,
							0,
							1,
							2,
							2,
							1,
							4,
							2,
							5,
							0,
							4,
							1,
							5,
							4,
							4,
							3,
							3,
							3,
							2,
							3,
							4,
							5,
							0,
							5,
							0,
							1,
							5,
							0,
							0,
							2,
							5,
							3,
							3,
							5,
							5,
							5,
							2,
							0
						};
						this.savedata.hairType = array[this.savedata.hairId[0]];
					}
					else
					{
						this.savedata.personality = 0;
					}
					this.ConvertShapeValue();
				}
				result = true;
			}
		}
		return result;
	}

	// Token: 0x060010CF RID: 4303 RVA: 0x00079464 File Offset: 0x00077664
	public virtual void ConvertShapeValue()
	{
		if (this.convertType == global::CharSave_SexyBeachPR.ConvertType.HoneySelect)
		{
			if (this.savedata.sex == 0)
			{
				this.savedata.shapeBody = new float[21];
				for (int i = 0; i < this.savedata.shapeBody.Length; i++)
				{
					this.savedata.shapeBody[i] = this.savedata.sbpr_shapeBody[i];
				}
				this.savedata.shapeFace = new float[67];
				int[] array = new int[]
				{
					0,
					1,
					2,
					3,
					4,
					5,
					6,
					7,
					8,
					9,
					10,
					11,
					12,
					27,
					28,
					29,
					30,
					31,
					32,
					49,
					65,
					50,
					51,
					52,
					33,
					34,
					35,
					36,
					37,
					38,
					39,
					40,
					41,
					42,
					43,
					44,
					45,
					46,
					47,
					48,
					13,
					14,
					15,
					16,
					17,
					18,
					19,
					20,
					21,
					66,
					22,
					23,
					24,
					25,
					26,
					58,
					59,
					60,
					61,
					62,
					63,
					64,
					53,
					54,
					55,
					56,
					57
				};
				for (int j = 0; j < 67; j++)
				{
					this.savedata.shapeFace[j] = this.savedata.sbpr_shapeFace[array[j]];
				}
			}
			else
			{
				this.savedata.shapeBody = new float[32];
				for (int k = 0; k < this.savedata.shapeBody.Length; k++)
				{
					this.savedata.shapeBody[k] = this.savedata.sbpr_shapeBody[k];
				}
				this.savedata.shapeFace = new float[67];
				int[] array2 = new int[]
				{
					0,
					1,
					2,
					3,
					4,
					5,
					6,
					7,
					8,
					9,
					10,
					11,
					12,
					27,
					28,
					29,
					30,
					31,
					32,
					48,
					49,
					50,
					51,
					52,
					33,
					34,
					35,
					36,
					37,
					38,
					65,
					39,
					40,
					41,
					42,
					43,
					44,
					45,
					46,
					47,
					13,
					14,
					15,
					16,
					17,
					18,
					19,
					20,
					21,
					66,
					22,
					23,
					24,
					25,
					26,
					58,
					59,
					60,
					61,
					62,
					63,
					64,
					53,
					54,
					55,
					56,
					57
				};
				for (int l = 0; l < 67; l++)
				{
					this.savedata.shapeFace[l] = this.savedata.sbpr_shapeFace[array2[l]];
				}
			}
		}
	}

	// Token: 0x060010D0 RID: 4304 RVA: 0x000795D8 File Offset: 0x000777D8
	public virtual bool LoadClothesData(byte[] data, int version, byte sex)
	{
		bool result;
		using (MemoryStream memoryStream = new MemoryStream(data))
		{
			using (BinaryReader binaryReader = new BinaryReader(memoryStream))
			{
				this.savedata.coord = new global::CharSave_SexyBeachPR.Coordinate[2];
				binaryReader.BaseStream.Seek(1L, SeekOrigin.Current);
				for (int i = 0; i < this.savedata.coord.Length; i++)
				{
					this.savedata.coord[i] = new global::CharSave_SexyBeachPR.Coordinate();
					if (sex == 0)
					{
						this.savedata.coord[i].clothesTopId = binaryReader.ReadInt32();
						this.savedata.coord[i].shoesId = binaryReader.ReadInt32();
						if (version >= 2)
						{
							this.savedata.coord[i].clothesTopColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
							this.savedata.coord[i].clothesTopColor.Load(binaryReader, (int)this.convertType);
							this.savedata.coord[i].shoesColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
							this.savedata.coord[i].shoesColor.Load(binaryReader, (int)this.convertType);
						}
					}
					else
					{
						this.savedata.coord[i].clothesTopId = binaryReader.ReadInt32();
						this.savedata.coord[i].clothesBotId = binaryReader.ReadInt32();
						this.savedata.coord[i].braId = binaryReader.ReadInt32();
						this.savedata.coord[i].shortsId = binaryReader.ReadInt32();
						this.savedata.coord[i].glovesId = binaryReader.ReadInt32();
						this.savedata.coord[i].panstId = binaryReader.ReadInt32();
						this.savedata.coord[i].socksId = binaryReader.ReadInt32();
						this.savedata.coord[i].shoesId = binaryReader.ReadInt32();
						this.savedata.coord[i].swimsuitId = binaryReader.ReadInt32();
						this.savedata.coord[i].swimTopId = binaryReader.ReadInt32();
						this.savedata.coord[i].swimBotId = binaryReader.ReadInt32();
						if (this.convertType == global::CharSave_SexyBeachPR.ConvertType.HoneySelect)
						{
							if (this.savedata.coord[i].clothesTopId == 102 || this.savedata.coord[i].clothesTopId == 111)
							{
								this.savedata.coord[i].clothesTopId = 101;
							}
							if (this.savedata.coord[i].clothesBotId == 82)
							{
								this.savedata.coord[i].clothesBotId = 0;
							}
							if (this.savedata.coord[i].swimsuitId == 46)
							{
								this.savedata.coord[i].swimsuitId = 50;
							}
						}
						if (version >= 2)
						{
							this.savedata.coord[i].clothesTopColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
							this.savedata.coord[i].clothesTopColor.Load(binaryReader, (int)this.convertType);
							this.savedata.coord[i].clothesBotColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
							this.savedata.coord[i].clothesBotColor.Load(binaryReader, (int)this.convertType);
							this.savedata.coord[i].braColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
							this.savedata.coord[i].braColor.Load(binaryReader, (int)this.convertType);
							this.savedata.coord[i].shortsColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
							this.savedata.coord[i].shortsColor.Load(binaryReader, (int)this.convertType);
							this.savedata.coord[i].glovesColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
							this.savedata.coord[i].glovesColor.Load(binaryReader, (int)this.convertType);
							this.savedata.coord[i].panstColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
							this.savedata.coord[i].panstColor.Load(binaryReader, (int)this.convertType);
							this.savedata.coord[i].socksColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
							this.savedata.coord[i].socksColor.Load(binaryReader, (int)this.convertType);
							this.savedata.coord[i].shoesColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
							this.savedata.coord[i].shoesColor.Load(binaryReader, (int)this.convertType);
							this.savedata.coord[i].swimsuitColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
							this.savedata.coord[i].swimsuitColor.Load(binaryReader, (int)this.convertType);
							this.savedata.coord[i].swimTopColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
							this.savedata.coord[i].swimTopColor.Load(binaryReader, (int)this.convertType);
							this.savedata.coord[i].swimBotColor = new global::CharSave_SexyBeachPR.ColorSetSBPR();
							this.savedata.coord[i].swimBotColor.Load(binaryReader, (int)this.convertType);
						}
					}
				}
				if (sex == 0)
				{
					if (version >= 2)
					{
						binaryReader.BaseStream.Seek(1L, SeekOrigin.Current);
					}
				}
				else if (version >= 1)
				{
					this.savedata.stateSwimOptTop = binaryReader.ReadByte();
					this.savedata.stateSwimOptBot = binaryReader.ReadByte();
					binaryReader.BaseStream.Seek(1L, SeekOrigin.Current);
				}
				this.savedata.accessory = new global::CharSave_SexyBeachPR.Accessory[2, 5];
				this.savedata.accessoryColor = new global::CharSave_SexyBeachPR.ColorSetSBPR[2, 5];
				for (int j = 0; j < 2; j++)
				{
					for (int k = 0; k < 5; k++)
					{
						this.savedata.accessory[j, k] = new global::CharSave_SexyBeachPR.Accessory();
						this.savedata.accessory[j, k].Load(binaryReader);
						if (version >= 2)
						{
							this.savedata.accessoryColor[j, k] = new global::CharSave_SexyBeachPR.ColorSetSBPR();
							this.savedata.accessoryColor[j, k].Load(binaryReader, (int)this.convertType);
						}
					}
				}
				result = true;
			}
		}
		return result;
	}

	// Token: 0x0400123A RID: 4666
	public const string CharaFileFemaleDir = "chara/female/";

	// Token: 0x0400123B RID: 4667
	public const string CharaFileMaleDir = "chara/male/";

	// Token: 0x0400123C RID: 4668
	public const string CharaFileFemaleMark = "【PremiumResortCharaFemale】";

	// Token: 0x0400123D RID: 4669
	public const string CharaFileMaleMark = "【PremiumResortCharaMale】";

	// Token: 0x0400123E RID: 4670
	public const int CharaFileVersion = 1;

	// Token: 0x0400123F RID: 4671
	public const int PreviewVersion = 1;

	// Token: 0x04001240 RID: 4672
	public const int CustomVersion = 5;

	// Token: 0x04001241 RID: 4673
	public const int ClothesVersion = 2;

	// Token: 0x04001242 RID: 4674
	public const int MaleShapeFaceNum = 67;

	// Token: 0x04001243 RID: 4675
	public const int MaleShapeBodyNum = 21;

	// Token: 0x04001244 RID: 4676
	public const int FemaleShapeFaceNum = 67;

	// Token: 0x04001245 RID: 4677
	public const int FemaleShapeBodyNum = 32;

	// Token: 0x04001246 RID: 4678
	public const int CoordinateNum = 2;

	// Token: 0x04001247 RID: 4679
	public const int AccessorySlotNum = 5;

	// Token: 0x020002A8 RID: 680
	public class ColorSetSBPR
	{
		// Token: 0x060010D2 RID: 4306 RVA: 0x00079CD0 File Offset: 0x00077ED0
		public virtual void Load(BinaryReader reader, int convertType)
		{
			this.diffuseColor.H = (float)reader.ReadDouble();
			this.diffuseColor.S = (float)reader.ReadDouble();
			this.diffuseColor.V = (float)reader.ReadDouble();
			this.alpha = (float)reader.ReadDouble();
			this.specularColor.H = (float)reader.ReadDouble();
			this.specularColor.S = (float)reader.ReadDouble();
			this.specularColor.V = (float)reader.ReadDouble();
			this.specularIntensity = (float)reader.ReadDouble();
			this.specularSharpness = (float)reader.ReadDouble();
			if (convertType == 0)
			{
				this.specularIntensity = Mathf.InverseLerp(0f, 5f, this.specularIntensity) * 0.8f;
				this.specularSharpness = Mathf.InverseLerp(0f, 9f, this.specularSharpness) * 0.9f;
			}
		}

		// Token: 0x060010D3 RID: 4307 RVA: 0x00079DB8 File Offset: 0x00077FB8
		public virtual void CopyToHoneySelect(global::HSColorSet dst)
		{
			dst.hsvDiffuse.Copy(this.diffuseColor);
			dst.alpha = this.alpha;
			dst.hsvSpecular.Copy(this.specularColor);
			dst.specularIntensity = this.specularIntensity;
			dst.specularSharpness = this.specularSharpness;
		}

		// Token: 0x0400124A RID: 4682
		public global::HsvColor diffuseColor = new global::HsvColor(20f, 0.8f, 0.8f);

		// Token: 0x0400124B RID: 4683
		public float alpha = 1f;

		// Token: 0x0400124C RID: 4684
		public global::HsvColor specularColor = new global::HsvColor(0f, 0f, 0.8f);

		// Token: 0x0400124D RID: 4685
		public float specularIntensity = 0.5f;

		// Token: 0x0400124E RID: 4686
		public float specularSharpness = 3f;
	}

	// Token: 0x020002A9 RID: 681
	public class Coordinate
	{
		// Token: 0x0400124F RID: 4687
		public int clothesTopId;

		// Token: 0x04001250 RID: 4688
		public global::CharSave_SexyBeachPR.ColorSetSBPR clothesTopColor;

		// Token: 0x04001251 RID: 4689
		public int clothesBotId;

		// Token: 0x04001252 RID: 4690
		public global::CharSave_SexyBeachPR.ColorSetSBPR clothesBotColor;

		// Token: 0x04001253 RID: 4691
		public int braId;

		// Token: 0x04001254 RID: 4692
		public global::CharSave_SexyBeachPR.ColorSetSBPR braColor;

		// Token: 0x04001255 RID: 4693
		public int shortsId;

		// Token: 0x04001256 RID: 4694
		public global::CharSave_SexyBeachPR.ColorSetSBPR shortsColor;

		// Token: 0x04001257 RID: 4695
		public int glovesId;

		// Token: 0x04001258 RID: 4696
		public global::CharSave_SexyBeachPR.ColorSetSBPR glovesColor;

		// Token: 0x04001259 RID: 4697
		public int panstId;

		// Token: 0x0400125A RID: 4698
		public global::CharSave_SexyBeachPR.ColorSetSBPR panstColor;

		// Token: 0x0400125B RID: 4699
		public int socksId;

		// Token: 0x0400125C RID: 4700
		public global::CharSave_SexyBeachPR.ColorSetSBPR socksColor;

		// Token: 0x0400125D RID: 4701
		public int shoesId;

		// Token: 0x0400125E RID: 4702
		public global::CharSave_SexyBeachPR.ColorSetSBPR shoesColor;

		// Token: 0x0400125F RID: 4703
		public int swimsuitId;

		// Token: 0x04001260 RID: 4704
		public global::CharSave_SexyBeachPR.ColorSetSBPR swimsuitColor;

		// Token: 0x04001261 RID: 4705
		public int swimTopId;

		// Token: 0x04001262 RID: 4706
		public global::CharSave_SexyBeachPR.ColorSetSBPR swimTopColor;

		// Token: 0x04001263 RID: 4707
		public int swimBotId;

		// Token: 0x04001264 RID: 4708
		public global::CharSave_SexyBeachPR.ColorSetSBPR swimBotColor;
	}

	// Token: 0x020002AA RID: 682
	public class Accessory
	{
		// Token: 0x060010D6 RID: 4310 RVA: 0x00079E64 File Offset: 0x00078064
		public virtual void Load(BinaryReader reader)
		{
			this.accessoryType = reader.ReadInt32();
			this.accessoryId = reader.ReadInt32();
			this.parentKey = reader.ReadString();
			this.plusPos.x = (float)reader.ReadDouble();
			this.plusPos.y = (float)reader.ReadDouble();
			this.plusPos.z = (float)reader.ReadDouble();
			this.plusRot.x = (float)reader.ReadDouble();
			this.plusRot.y = (float)reader.ReadDouble();
			this.plusRot.z = (float)reader.ReadDouble();
			this.plusScl.x = (float)reader.ReadDouble();
			this.plusScl.y = (float)reader.ReadDouble();
			this.plusScl.z = (float)reader.ReadDouble();
		}

		// Token: 0x04001265 RID: 4709
		public int accessoryType = -1;

		// Token: 0x04001266 RID: 4710
		public int accessoryId = -1;

		// Token: 0x04001267 RID: 4711
		public string parentKey = string.Empty;

		// Token: 0x04001268 RID: 4712
		public Vector3 plusPos = Vector3.zero;

		// Token: 0x04001269 RID: 4713
		public Vector3 plusRot = Vector3.zero;

		// Token: 0x0400126A RID: 4714
		public Vector3 plusScl = Vector3.one;
	}

	// Token: 0x020002AB RID: 683
	public class SaveData
	{
		// Token: 0x0400126B RID: 4715
		public string fileName = string.Empty;

		// Token: 0x0400126C RID: 4716
		public byte[] pngData;

		// Token: 0x0400126D RID: 4717
		public int fileVersion;

		// Token: 0x0400126E RID: 4718
		public byte sex;

		// Token: 0x0400126F RID: 4719
		public int customVersion;

		// Token: 0x04001270 RID: 4720
		public int personality;

		// Token: 0x04001271 RID: 4721
		public string name = string.Empty;

		// Token: 0x04001272 RID: 4722
		public int headId;

		// Token: 0x04001273 RID: 4723
		public float[] sbpr_shapeFace;

		// Token: 0x04001274 RID: 4724
		public float[] sbpr_shapeBody;

		// Token: 0x04001275 RID: 4725
		public float[] shapeFace;

		// Token: 0x04001276 RID: 4726
		public float[] shapeBody;

		// Token: 0x04001277 RID: 4727
		public int[] hairId;

		// Token: 0x04001278 RID: 4728
		public int hairType;

		// Token: 0x04001279 RID: 4729
		public global::CharSave_SexyBeachPR.ColorSetSBPR[] hairColor;

		// Token: 0x0400127A RID: 4730
		public global::CharSave_SexyBeachPR.ColorSetSBPR[] hairAcsColor;

		// Token: 0x0400127B RID: 4731
		public int texFaceId;

		// Token: 0x0400127C RID: 4732
		public global::CharSave_SexyBeachPR.ColorSetSBPR skinColor;

		// Token: 0x0400127D RID: 4733
		public int texEyeshadowId;

		// Token: 0x0400127E RID: 4734
		public global::CharSave_SexyBeachPR.ColorSetSBPR eyeshadowColor;

		// Token: 0x0400127F RID: 4735
		public int texCheekId;

		// Token: 0x04001280 RID: 4736
		public global::CharSave_SexyBeachPR.ColorSetSBPR cheekColor;

		// Token: 0x04001281 RID: 4737
		public int texLipId;

		// Token: 0x04001282 RID: 4738
		public global::CharSave_SexyBeachPR.ColorSetSBPR lipColor;

		// Token: 0x04001283 RID: 4739
		public int texTattoo_fId;

		// Token: 0x04001284 RID: 4740
		public global::CharSave_SexyBeachPR.ColorSetSBPR tattoo_fColor;

		// Token: 0x04001285 RID: 4741
		public int texMoleId;

		// Token: 0x04001286 RID: 4742
		public global::CharSave_SexyBeachPR.ColorSetSBPR moleColor;

		// Token: 0x04001287 RID: 4743
		public int matEyebrowId;

		// Token: 0x04001288 RID: 4744
		public global::CharSave_SexyBeachPR.ColorSetSBPR eyebrowColor;

		// Token: 0x04001289 RID: 4745
		public int matEyelashesId;

		// Token: 0x0400128A RID: 4746
		public global::CharSave_SexyBeachPR.ColorSetSBPR eyelashesColor;

		// Token: 0x0400128B RID: 4747
		public int matEyeLId;

		// Token: 0x0400128C RID: 4748
		public global::CharSave_SexyBeachPR.ColorSetSBPR eyeLColor;

		// Token: 0x0400128D RID: 4749
		public int matEyeRId;

		// Token: 0x0400128E RID: 4750
		public global::CharSave_SexyBeachPR.ColorSetSBPR eyeRColor;

		// Token: 0x0400128F RID: 4751
		public int matEyeHiId;

		// Token: 0x04001290 RID: 4752
		public global::CharSave_SexyBeachPR.ColorSetSBPR eyeHiColor;

		// Token: 0x04001291 RID: 4753
		public global::CharSave_SexyBeachPR.ColorSetSBPR eyeWColor;

		// Token: 0x04001292 RID: 4754
		public float faceDetailWeight;

		// Token: 0x04001293 RID: 4755
		public int texBodyId;

		// Token: 0x04001294 RID: 4756
		public int texSunburnId;

		// Token: 0x04001295 RID: 4757
		public global::CharSave_SexyBeachPR.ColorSetSBPR sunburnColor;

		// Token: 0x04001296 RID: 4758
		public int texTattoo_bId;

		// Token: 0x04001297 RID: 4759
		public global::CharSave_SexyBeachPR.ColorSetSBPR tattoo_bColor;

		// Token: 0x04001298 RID: 4760
		public int matNipId;

		// Token: 0x04001299 RID: 4761
		public global::CharSave_SexyBeachPR.ColorSetSBPR nipColor;

		// Token: 0x0400129A RID: 4762
		public int matUnderhairId;

		// Token: 0x0400129B RID: 4763
		public global::CharSave_SexyBeachPR.ColorSetSBPR underhairColor;

		// Token: 0x0400129C RID: 4764
		public global::CharSave_SexyBeachPR.ColorSetSBPR nailColor;

		// Token: 0x0400129D RID: 4765
		public float nipSize = 0.5f;

		// Token: 0x0400129E RID: 4766
		public float bodyDetailWeight;

		// Token: 0x0400129F RID: 4767
		public int beardId;

		// Token: 0x040012A0 RID: 4768
		public global::CharSave_SexyBeachPR.ColorSetSBPR beardColor;

		// Token: 0x040012A1 RID: 4769
		public float bustSoftness = 0.5f;

		// Token: 0x040012A2 RID: 4770
		public float bustWeight = 0.5f;

		// Token: 0x040012A3 RID: 4771
		public int clothesVersion;

		// Token: 0x040012A4 RID: 4772
		public global::CharSave_SexyBeachPR.Coordinate[] coord;

		// Token: 0x040012A5 RID: 4773
		public byte stateSwimOptTop;

		// Token: 0x040012A6 RID: 4774
		public byte stateSwimOptBot;

		// Token: 0x040012A7 RID: 4775
		public global::CharSave_SexyBeachPR.Accessory[,] accessory;

		// Token: 0x040012A8 RID: 4776
		public global::CharSave_SexyBeachPR.ColorSetSBPR[,] accessoryColor;
	}

	// Token: 0x020002AC RID: 684
	public enum ConvertType
	{
		// Token: 0x040012AA RID: 4778
		HoneySelect
	}
}
